use "data_rep_12132019_final.dta" 

******************
** make figures **
******************

** figure 1 **

reg out_aff_100 i.treatment
margins, dydx(treatment)
marginsplot, title("Out-Group Affect Index") ytitle("Average Treatment Effect") recast(scatter) b1title("Treatment Assignment") yline(0) xtitle("") xlab(.5 " " 1 "Widespread" 2 "Targeted" 2.5 " ", notick) aspectratio(1)

reg avg_dist_stan i.treatment
margins, dydx(treatment)
marginsplot, title("Distance from Out-Group Preferences Index") ytitle("Average Treatment Effect") recast(scatter) b1title("Treatment Assignment") yline(0) xtitle("") xlab(.5 " " 1 "Widespread" 2 "Targeted" 2.5 " ", notick) aspectratio(1)

* figure 2
reg in_ID_100 i.treatment
margins, dydx(treatment)
marginsplot, title("In-Group Identification Index") ytitle("Average Treatment Effect") recast(scatter) b1title("Treatment Assignment") yline(0) xtitle("") xlab(.5 " " 1 "Widespread" 2 "Targeted" 2.5 " ", notick) aspectratio(1)

reg out_ID_100 i.treatment
margins, dydx(treatment)
marginsplot, title("Out-Group Identification Index") ytitle("Average Treatment Effect") recast(scatter) b1title("Treatment Assignment") yline(0) xtitle("") xlab(.5 " " 1 "Widespread" 2 "Targeted" 2.5 " ", notick) aspectratio(1)


*****************
** make tables **
*****************

** table 2

* column 1
reg out_aff_100 in_ID_100, vce(cluster session)

* column 2
reg out_aff_100 in_ID_100 pre_econ pre_relig employ educ income pray read pre_trust join enum_gender enum_veiled groups, vce(cluster session)

* column 3 
reg out_aff_100 out_ID_100, vce(cluster session)

* column 4 
reg out_aff_100 out_ID_100 pre_econ pre_relig employ educ income pray read pre_trust join enum_gender enum_veiled groups, vce(cluster session)

***
***
***

** table 3

* column 1
reg avg_dist_stan in_ID_100, vce(cluster session)

* column 2
reg avg_dist_stan in_ID_100 pre_econ pre_relig employ educ income pray read pre_trust join enum_gender enum_veiled groups, vce(cluster session)

* cloumn 3
reg avg_dist_stan out_ID_100, vce(cluster session)

* column 4
reg avg_dist_stan out_ID_100 pre_econ pre_relig employ educ income pray read pre_trust join enum_gender enum_veiled groups, vce(cluster session)

***
***
***

** table 4

* column 1
reg out_aff_100 i.treatment pre_econ pre_relig employ educ income pray read pre_trust join enum_gender enum_veiled groups, vce(cluster session)

* column 2
reg out_aff_100 i.treatment in_ID_100 pre_econ pre_relig employ educ income pray read pre_trust join enum_gender enum_veiled groups, vce(cluster session)

* column 3
reg out_aff_100 i.treatment out_ID_100 pre_econ pre_relig employ educ income pray read pre_trust join enum_gender enum_veiled groups, vce(cluster session)


* column 4
reg out_aff_100 i.treatment in_ID_100 out_ID_100 pre_econ pre_relig employ educ income pray read pre_trust join enum_gender enum_veiled groups, vce(cluster session)

***
***
***

** table 5

* column 1
reg avg_dist_stan i.treatment pre_econ pre_relig employ educ income pray read pre_trust join enum_gender enum_veiled groups, vce(cluster session)

* column 2
reg avg_dist_stan i.treatment in_ID_100 pre_econ pre_relig employ educ income pray read pre_trust join enum_gender enum_veiled groups, vce(cluster session)

* column 3
reg avg_dist_stan i.treatment out_ID_100 pre_econ pre_relig employ educ income pray read pre_trust join enum_gender enum_veiled groups, vce(cluster session)

* column 4
reg avg_dist_stan i.treatment in_ID_100 out_ID_100 pre_econ pre_relig employ educ income pray read pre_trust join enum_gender enum_veiled groups, vce(cluster session)

